<template>
  <Layout title="业主情况" :has-back="false" :has-tabbar="true" ref="layout">
    <view
      style="
        margin: 20rpx;
        border-left: 2rpx solid #ebebec;
        border-right: 2rpx solid #ebebec;
      "
    >
      <u-cell-group>
        <u-cell
          icon="info-circle"
          title="房屋信息"
          :clickable="true"
          :isLink="true"
          @click="cellClick('房屋信息')"
          :iconStyle="{ fontSize: '50rpx' }"
          :titleStyle="{ fontSize: '40rpx' }"
        >
          <template #right-icon>
            <view style="display: flex; align-items: center">
              <u-icon name="arrow-right"></u-icon>
            </view>
          </template>
        </u-cell>
        <u-cell
          icon="question-circle"
          title="业户诉求"
          :clickable="true"
          :isLink="true"
          @click="cellClick('业户诉求')"
          :iconStyle="{ fontSize: '50rpx' }"
          :titleStyle="{ fontSize: '40rpx' }"
        >
          <template #right-icon>
            <view style="display: flex; align-items: center">
              <u-icon name="arrow-right"></u-icon>
            </view>
          </template>
        </u-cell>
        <u-cell
          icon="rmb-circle"
          title="缴费情况"
          :clickable="true"
          :isLink="true"
          @click="cellClick('缴费情况')"
          :iconStyle="{ fontSize: '50rpx' }"
          :titleStyle="{ fontSize: '40rpx' }"
        >
          <template #right-icon>
            <view style="display: flex; align-items: center">
              <u-icon name="arrow-right"></u-icon>
            </view>
          </template>
        </u-cell>
      </u-cell-group>
    </view>
  </Layout>
</template>

<script>
import Layout from "@/pages/component/layout/index.vue";
import { showErrorToast } from "@/util/message";

export default {
  name: "Owner",
  components: { Layout },
  onShow() {
    this.$refs.layout.setTabbarStyle("业主情况");
  },
  methods: {
    cellClick(name) {
      if (name === "房屋信息") {
        uni.navigateTo({
          url: "/sub/owner/home-info/index",
          fail: (error) => {
            showErrorToast(error);
          },
        });
      } else if (name === "业户诉求") {
        uni.navigateTo({
          url: "/sub/owner/question/index",
          fail: (error) => {
            showErrorToast(error);
          },
        });
      } else if (name === "缴费情况") {
        uni.navigateTo({
          url: "/sub/owner/pay/index",
          fail: (error) => {
            showErrorToast(error);
          },
        });
      }
    },
  },
};
</script>
